package com.rambo.baselib.httpapi;

import com.haibin.retrofit.call.Call;
import com.haibin.retrofit.net.*;
import com.rambo.baselib.model.wanad.WanAdApiArticle;
import com.rambo.baselib.model.wanad.WanAdApiPage;
import com.rambo.baselib.model.wanad.WanAdApiResult;

import java.util.List;

public interface WanAdApiService {

    //Call内填写返回json对应的格式Java bean实体类
    @POST("http://xxx/api/Users/PostLogin")
    Call<String> login(@Form("email") String email,
                       @Form("pwd") String pwd,
                       @Form("versionNum") int versionNum,
                       @Form("dataFrom") int dataFrom);


    //https://www.wanandroid.com/article/list/0/json 首页文章  页码从0开始
    @GET("article/list/{curPage}/json")
    Call<WanAdApiResult<WanAdApiPage<List<WanAdApiArticle>>>> getHomeArticle(@Path("curPage") long curPage,
                                                                             @Form("page_size") long pageSize);

    //https://wanandroid.com/wxarticle/list/408/1/json  查看某个公众号历史数据 页码从1开始 408 :公众号 ID
    @GET("wxarticle/list/408/{curPage}/json")
    Call<WanAdApiResult<WanAdApiPage<List<WanAdApiArticle>>>> getWxArticle(@Path("curPage") long curPage,
                                                                           @Form("page_size") long pageSize);

    //https://www.wanandroid.com/project/list/1/json?cid=294  某一个分类下项目列表数据 cid 项目分类id
    @GET("project/list/{curPage}/json")
    Call<WanAdApiResult<WanAdApiPage<List<WanAdApiArticle>>>> getProject(@Path("curPage") long curPage,
                                                                         @Form("page_size") long pageSize,
                                                                         @Form("cid") int cid);

    //https://www.wanandroid.com/project/tree/json  项目分类
    @GET("project/tree/json")
    Call<WanAdApiResult<List<WanAdApiArticle>>> getProjectCase();
}
